<?php
namespace app\admin\controller;
use app\admin\dbhelp\CHelper;
use app\admin\dbhelp\DbHelper;

class Article extends CHelper
{
    public function __construct()
    {
        parent::__construct('article');
    }
    public function index()
    {
        $key = input('key');
        $map = [];
        if($key&&$key!==""){
            $map['title'] = ['like',"%" . $key . "%"];
        }
        $this->assign('val',$key);
        $list = $this->db_helper->getAll('*',$map);
        $count = $this->db_helper->getCount($map);
        $this->assign('_count',$count);
        $this->assign('_list',$list);
        return view();
    }
}